@import ".\\_LDiv_NameInput.scss";

$hover_background-color: #ddd;

body{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 95vh;

    flex-direction: column;

    position: relative;
    background-image: url('../image/CH.jpg');
}

.MainHeader {
    padding: 30px;

    justify-content: center;
    flex-direction: column;
    align-items: center;

    div {
      font-size: 35px;
      margin: 10px;
    }
  }

  .MainContainer,
  .MainHeader {
    display: flex;
  }

  .GoodDataForm,
  .Menu,
  .MainHeader,
  .EditDiv,
  .MainTable {
    border-radius: 5px;
    box-shadow: 0 0 4px black;
    margin: 10px;

    font-size: 20px;
  }
  .Menu {
    margin: 0;
  }

  .MainTable {
    thead {
      -webkit-user-select: none;    // 支持 Safari 和 Safari on iOS
      -ms-user-select: none;        // 支持 Microsoft Edge
      user-select: none;            // 禁止用户选择文本
      th {
        cursor: pointer;
        font-size: 30px;
      }
    }
    tbody {
      tr {
        td {
          border-top: 1px solid black;
          padding: 10px 30px;
          margin: 0;
        }
        &:hover {
          background-color: $hover_background-color;
        }
      }
    }
  }

  .EditDiv {
    padding: 10px 20px;

    .LDiv_NamedInput,
    .Btn {
      padding: 5px 15px;
      margin: 5px;
    }

    .Btn {
      cursor: pointer;

      display: flex;
      justify-content: center;

      box-shadow: 0 0 2px black;
      &:hover {
        background-color: $hover_background-color;
      }
    }
    .GoodNames,
  .LDiv_NamedInput {
    width: 100%;
    padding: 10px 0;
    .input {
      width: 85%;
    }
  }

  .GoodNames {
    display: flex;
    justify-content: center;
    align-items: center;

    .GoodDiv {
      margin: 5px;
      padding: 5px;
      border: 1px ridge black;
      border-radius: 5px;
      font-size: 15px;

      text-align: center;
      height: 100%;
      line-height: 100%;

      &.active {
        font-size: 25px;
        box-shadow: 0 0 4px black;
        background-color: lightgreen;
      }
    }
  }
}

.Menu {
  position: absolute;
  box-shadow: 0 0 8px black;

  background-color: white;

  width: 150px;

  .MenuItem {
    padding: 10px 20px;
    cursor: pointer;

    &:hover {
      background-color: $hover_background-color;
    }
  }
}

.GoodDataForm {
  width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;    /* 在主轴上居中对齐子项目 */
  align-items: center;        /* 在交叉轴上居中对齐子项目 */

  .LDiv_NamedInput {
    width: 80%;
    margin-left: -20px;
    padding: 10px 0;
  }

  .CancelButton,
  .CommittedButton {
    box-shadow: 0 0 2px green;
    text-align: center;
    background-color: lightgreen;
    cursor: pointer;
    width: 80%;
    padding: 10px 0;

    &:focus {
      background-color: green;
    }
  }
  .CancelButton {
    margin-top: 10px;
    background-color: lightcoral;
  }
}
